package serviceImpl;

import dao.IUserDao;
import models.User;

/**
 * Created by 国彬 on 2016/7/2.
 */
public class UserDaoImpl implements IUserDao{


    @Override
    public void insert(User user) {
        user.save();
    }

    public int findByPhone(String phone){
        return (int)User.count("phone=?",phone);
    }

    @Override
    public User findByPhoneAndPwd(String phone, String pwd) {
       return User.find("phone=? and password=?",phone,pwd).first();
    }


}
